_Control
in such a way that the
serdClrXOff
(csCode = 22)
is mistaken for a block device "Return Media Icon" (csCode = 22) call. This
causes the serdClrXOff
to never make it to the serial driver.
The simplest workaround is to clear ioVRefNum
before making the serdClrXOff
call. The following code snippet demonstrates this technique.
OSErr DoClearXOff(short serialOutDrvrRefNum) { CntrlParam pb; pb.ioCRefNum = serialOutDrvrRefNum; pb.csCode = serdClrXOff; pb.ioVRefNum = 0; // This above line is required because of a bug // in system software. The workaround, clearing // ioVRefNum, should be benign when the bug is fixed // in future systems. return ( PBControlSync( (ParmBlkPtr) &pb ) ); }
This bug was fixed in Mac OS 8.0.